package gov.ccswj.modules.bdbusiness.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import gov.ccswj.modules.bdbusiness.dao.ANmDao;
import gov.ccswj.modules.bdbusiness.entity.ANmEntity;
import gov.ccswj.modules.bdbusiness.service.ANmService;



@Service("aNmService")
public class ANmServiceImpl implements ANmService {
	@Autowired
	private ANmDao aNmDao;
	
	@Override
	public ANmEntity queryObject(Integer cityId){
		ANmEntity aNmEntity = aNmDao.queryObject(cityId);
		if (aNmEntity.getXqNum()>0) {
			aNmEntity.setXq(aNmDao.queryXq(cityId));
		}
		if (aNmEntity.getZcNum()>0) {
			aNmEntity.setZc(aNmDao.queryZc(cityId));
		}
		if (aNmEntity.getKfqNum()>0) {
			aNmEntity.setKfq(aNmDao.queryKfq(cityId));
		}
		return aNmEntity;
	}
	
	@Override
	public List<ANmEntity> queryList(Map<String, Object> map){
		return aNmDao.queryList(map);
	}
	
	@Override
	public int queryTotal(Map<String, Object> map){
		return aNmDao.queryTotal(map);
	}
	
	@Override
	public void save(ANmEntity aNm){
		aNmDao.save(aNm);
	}
	
	@Override
	public void update(ANmEntity aNm){
		aNmDao.update(aNm);
	}
	
	@Override
	public void delete(Integer cityId){
		aNmDao.delete(cityId);
	}
	
	@Override
	public void deleteBatch(Integer[] cityIds){
		aNmDao.deleteBatch(cityIds);
	}
	
}
